#include <stdio.h>

int stats()
{
  int miredopid;
  FILE *miredorun;

  miredorun = fopen("/var/run/miredo.pid", "r");
  if( miredorun == (FILE *)NULL )
    {
      printf("miredo未运行\n");
      return(-1);
    }

  if(fscanf( miredorun, "%d", &miredopid))
    {
      printf("miredo's pid = %d\n", miredopid);
      fclose( miredorun );
      return(1);
    }
  
  fclose( miredorun );
  return(-1);
}
